#include "gus2.h"
enum
{
	EColor = 0x44,
	EAngle = 0x45,
	EFlush = 0x50,
};
#if GUS2_ENABLE_ATTRI
const __gui_attr_needle CTRL_NEEDLE_ATTR = {
	/*.Color = */EColor,
	/*.Angle = */EAngle,
	/*.Flush = */EFlush,
};
#endif
void gui_needle_set_angle(bytearray_t* ba, float angle) {
	int iangle = (int)(angle * 1000);
	gui_ctrl_set_attrs(ba, "bbd", EAngle, 0x0, iangle);
}
void gui_needle_set_inc_angle(bytearray_t* ba, float angle) {
	int iangle = (int)(angle * 1000);
	gui_ctrl_set_attrs(ba, "bbd", EAngle, 0x1, iangle);
}
void gui_needle_set_ncolor(bytearray_t* ba,  gui_color_t color) {
	gui_ctrl_set_attrs(ba, "bbd", EColor, 0, color);
}
void gui_needle_set_ccolor(bytearray_t* ba,  gui_color_t color) {
	gui_ctrl_set_attrs(ba, "bbd", EColor, 1, color);
}
void gui_needle_set_flush(bytearray_t* ba)
{
	gui_ctrl_set_attrs(ba, "bb", EFlush, 1);
}


void gui_needles_set_angle(bytearray_t* ba, float angle, int index) {
	int iangle = (int)(angle * 1000);
	gui_ctrl_set_attrs(ba, "bbdb", EAngle, 0x0, iangle, index);
}
void gui_needles_set_inc_angle(bytearray_t* ba, float angle, int index) {
	int iangle = (int)(angle * 1000);
	gui_ctrl_set_attrs(ba, "bbdb", EAngle, 0x1, iangle, index);
}
void gui_needles_set_ncolor(bytearray_t* ba, gui_color_t color, int index) {
	index += 1;
	gui_ctrl_set_attrs(ba, "bdb", EColor, color, index);
}
void gui_needles_set_ccolor(bytearray_t* ba, gui_color_t color) {
	gui_ctrl_set_attrs(ba, "bdb", EColor, color, 0);
}
void gui_needles_set_flush(bytearray_t* ba)
{
	gui_ctrl_set_attrs(ba, "bb", EFlush, 1);
}

